//
//  WDPhotoHandler.h
//  testApp
//
//  Created by iMac on 2018/2/9.
//  Copyright © 2018年 iMac. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Photos/Photos.h>


@interface WDPhotoHandler : NSObject

+ (instancetype)defaultHandler;

/// 获取智能相册中的相册列表
- (NSArray<PHAssetCollection *> *)collectionsFromSmartAlbums;

/// 获取该相册的第一个asset对象
- (PHAsset *)firstInCollection:(PHAssetCollection *)colleciton;

/// 从一个相册中获取Assets集合, 按照创建时间排序
- (NSArray<PHAsset *> *)assetsFromCollection: (PHAssetCollection *)colleciton;

/// 根据一个collection 获取assets的个数
- (NSInteger)assetCountFromCollection:(PHAssetCollection *)collection;

/// 获取一张缩略图
- (void)thumbnalImage: (PHAsset *)asset size: (CGSize)size completion:(void (^)(UIImage *, NSDictionary *))completion;

/// 获取一张预览图
- (void)previewImage: (PHAsset *)asset completion:(void (^)(UIImage *, NSDictionary *))completion;

/// 获取一张原图(在 后台 线程)
- (void)originImage: (PHAsset *)asset completion:(void (^)(UIImage *, NSDictionary *))completion;

@end
